/*
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package com.germinus.telcoblocks.echarts.db;

import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;



public class Call
{
	
	private String fromAddr;
	private String toAddr;
	

	private String status;
	private String session;
	private Long id;
	private Date startDate;
	private Date endDate;
	
	public Call() {
	}
	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setFrom(String from) {
		this.fromAddr = from;
	}

	public void setTo(String to) {
		this.toAddr = to;
	}

	public Call(String from, String to) {
		this.fromAddr = from;
		this.toAddr = to;		
		this.startDate = new Date();
	}

	public String getFromAddr() {
		return fromAddr;
	}

	public void setFromAddr(String fromAddr) {
		this.fromAddr = fromAddr;
	}

	public String getToAddr() {
		return toAddr;
	}

	public void setToAddr(String toAddr) {
		this.toAddr = toAddr;
	}
	public void setSession(String sasid) {
		this.session=sasid;
	}
	
	public String getSession(){
		return session;
	}
	
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((fromAddr == null) ? 0 : fromAddr.hashCode());
		result = prime * result + ((toAddr == null) ? 0 : toAddr.hashCode());
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Call other = (Call) obj;
		if (fromAddr == null) {
			if (other.fromAddr != null)
				return false;
		} else if (!fromAddr.equals(other.fromAddr))
			return false;
		if (toAddr == null) {
			if (other.toAddr != null)
				return false;
		} else if (!toAddr.equals(other.toAddr))
			return false;
		return true;
	}

	
}
